<!-- head -->
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-md-12">
        <ol class="breadcrumb">
            <li><a>主页</a></li>
            <li><a>业务管理/积分抽奖</a></li>
            <li class="active"><strong>新增奖品信息</strong></li>
        </ol>
    </div>
</div>

<!-- content-->
<div class="wrapper wrapper-content animated fadeIn" ng-controller="busPrizeAddCtrl">
    <form class="form-horizontal" id="form1" name="horizontalCard">
        <div class="form-group">
            <div class="ibox float-e-margins">
                <div class="ibox-content">

                    <div class="row">
                        <div class="ibox-title">
                            <h5>新增奖品信息</h5>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>奖项说明:</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" name="awardDesc" required ng-model="addInfo.awardDesc">
                                <div class="req_mesg" ng-show="horizontalCard.awardDesc.$dirty && horizontalCard.awardDesc.$invalid">
                                    <span ng-show="horizontalCard.awardDesc.$error.required">奖项说明不能为空</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>奖品名称:</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" name="awardName" required ng-model="addInfo.awardName">
                                <div class="req_mesg" ng-show="horizontalCard.awardName.$dirty && horizontalCard.awardName.$invalid">
                                    <span ng-show="horizontalCard.awardName.$error.required">奖品名称不能为空</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>奖品数量:</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" name="awardNum" required ng-model="addInfo.awardNum" ng-pattern="/^(0|[1-9][0-9]*)$/" >
                                <div class="req_mesg" ng-show="horizontalCard.awardNum.$dirty && horizontalCard.awardNum.$invalid">
                                    <span ng-show="horizontalCard.awardNum.$error.required">奖品数量不能为空</span>
                                    <span ng-show="horizontalCard.awardNum.$error.pattern">奖品数量格式不符</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>中奖概率:</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" name="awardOdds" required ng-model="addInfo.awardOdds" ng-pattern="/^([1-9]\d{0,9}|0)(\.\d{1,3})?$/" >
                                <div class="req_mesg" ng-show="horizontalCard.awardOdds.$dirty && horizontalCard.awardOdds.$invalid">
                                    <span ng-show="horizontalCard.awardOdds.$error.required">中奖概率不能为空</span>
                                    <span ng-show="horizontalCard.awardOdds.$error.pattern">中奖概率格式不符</span>
                                </div>
                            </div>
                            <label style="margin-top:7px;">%</label>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>每天最多派发数量:</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" name="dayNums" required ng-model="addInfo.dayNums" ng-pattern="/^(0|[1-9][0-9]*)$/">
                                <div class="req_mesg" ng-show="horizontalCard.dayNums.$dirty && horizontalCard.dayNums.$invalid">
                                    <span ng-show="horizontalCard.dayNums.$error.required">每天最多派发数量不能为空</span>
                                    <span ng-show="horizontalCard.dayNums.$error.pattern">每天最多派发数量格式不符</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>每天最多中奖次数:</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" name="dayMax" required ng-model="addInfo.dayMax" ng-pattern="/^(0|[1-9][0-9]*)$/">
                                <div class="req_mesg" ng-show="horizontalCard.dayMax.$dirty && horizontalCard.dayMax.$invalid">
                                    <span ng-show="horizontalCard.dayMax.$error.required">每天最多中奖次数不能为空</span>
                                    <span ng-show="horizontalCard.dayMax.$error.pattern">每天最多中奖次数格式不符</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>下发序列号:</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" name="seqNo" required ng-model="addInfo.seqNo"  ng-pattern="/^[1-9][0-9]*$/" >
                                <div class="req_mesg" ng-show="horizontalCard.seqNo.$dirty && horizontalCard.seqNo.$invalid">
                                    <span ng-show="horizontalCard.seqNo.$error.required">下发序列号不能为空</span>
                                    <span ng-show="horizontalCard.seqNo.$error.pattern">下发序列号格式不符</span>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>中奖提示:</label>
                            <div class="col-sm-5">
                                <input type="text" class="form-control" name="awardNotice" required ng-model="addInfo.awardNotice">
                                <div class="req_mesg" ng-show="horizontalCard.awardNotice.$dirty && horizontalCard.awardNotice.$invalid">
                                    <span ng-show="horizontalCard.awardNotice.$error.required">中奖提示不能为空</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>奖品图片:</label>
                            <div class="col-sm-7">
                                <input type="file" nv-file-select="" uploader="uploaderImg"   multiple  />
                                <span style="margin: 3px;color: red;"><br>注意:仅支持上传500KB以内的图片</span>
                                <table class="table">
                                    <tbody>
                                    <tr ng-repeat="item in uploaderImg.queue">
                                        <td>
                                            <div ng-show="uploaderImg.isHTML5" ng-thumb="{ file: item._file, height: 100 }"></div>
                                        </td>
                                        <td nowrap>
                                            <button type="button" class="btn btn-danger btn-xs" ng-click="item.remove()">
                                                <span class="glyphicon glyphicon-trash"></span> 删除
                                            </button>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>奖品类型:</label>
                            <div class="col-sm-2">
                                <select class="form-control" ng-model="addInfo.prize.rewardType" name="rewardType" required ng-options="x.value as x.text for x in rewardTypeSelect" ng-change="awardTypeChange()"/>
                                <div class="req_mesg" ng-show="horizontalCard.rewardType.$dirty && horizontalCard.rewardType.$invalid">
                                    <span ng-show="horizontalCard.rewardType.$error.required">奖品类型不能为空</span>
                                </div>
                            </div>
                        </div>
                        <div ng-if="conSta">
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i class="red_req">*</i>选择券:</label>
                                <div class="col-sm-3">
                                    <select class="form-control" ng-model="addInfo.prize.calcType" name="calcType"  required ng-options="x.value as x.text for x in conList"/>
                                    <div class="req_mesg" ng-show="horizontalCard.calcType.$dirty && horizontalCard.calcType.$invalid">
                                        <span ng-show="horizontalCard.calcType.$error.required">选择券不能为空</span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i class="red_req">*</i>数量:</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="awardNum" required ng-model="addInfo.prize.awardNum" ng-pattern="/^[1-9][0-9]*$/" >
                                    <div class="req_mesg" ng-show="horizontalCard.awardNum.$dirty && horizontalCard.awardNum.$invalid">
                                        <span ng-show="horizontalCard.awardNum.$error.required">数量不能为空</span>
                                        <span ng-show="horizontalCard.awardNum.$error.pattern">数量格式不符</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div ng-if="numSta">
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i class="red_req">*</i>数值:</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="awardNum" required ng-model="addInfo.prize.awardNum" ng-pattern="/^[1-9][0-9]*$/" >
                                    <div class="req_mesg" ng-show="horizontalCard.awardNum.$dirty && horizontalCard.awardNum.$invalid">
                                        <span ng-show="horizontalCard.awardNum.$error.required">数值不能为空</span>
                                        <span ng-show="horizontalCard.awardNum.$error.pattern">数值格式不符</span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group" ng-if="integralSta">
                                <label class="col-sm-2 control-label"><i class="red_req">*</i>有效期:</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" style="width:100px; float:left" name="expireDay" required ng-model="addInfo.prize.expireDay">
                                    <span style="float:left; padding:7px 5PX 0 5PX;">单位:个月</span>
                                </div>
                            </div>
                        </div>
                        <div ng-if="moneySta">
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i class="red_req">*</i>金额:</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="awardNum" required ng-model="addInfo.prize.awardNum" ng-pattern="/^([1-9]\d{0,9}|0)(\.\d{1,2})?$/" >
                                    <div class="req_mesg" ng-show="horizontalCard.awardNum.$dirty && horizontalCard.awardNum.$invalid">
                                        <span ng-show="horizontalCard.awardNum.$error.required">金额不能为空</span>
                                        <span ng-show="horizontalCard.awardNum.$error.pattern">金额格式不符</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-12 bgff">
                <div class="col-sm-12">
                    <div class="col-sm-3"></div>
                    <div class="col-sm-6">
                        <button class="btn btn-primary btn-mr20" type="button" ng-click="commitInfo()" ng-disabled="horizontalCard.$invalid || submitting">提交</button>
                        <a class="btn btn-primary4" ng-click="goBackFun()" >返回</a>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>